# Create your views here.
from django.shortcuts import render_to_response
from django.http import HttpResponseRedirect
from data.models import Order, Table

def index(request):
    orders = Order.objects.all()
    stat_orders = Order.objects.count()
    table_lists = Table.objects.filter(is_free = False)
    if stat_orders != 0 :
        return render_to_response('kitchen/index.html',{'orders':orders,'stat_orders':stat_orders,'table_lists':table_lists})
    else:
        return render_to_response('kitchen/index.html')

